<template>
  <div class="nav-bar">
    <div class="header app-header">
      <van-nav-bar
        :left-text="props.leftText"
        left-arrow
        @click-left="onClickLeft"
        :border="false"
      >
        <template #right>
          <slot></slot>
        </template>
      </van-nav-bar>
    </div>
    <div class="app-header-nav-height"></div>
  </div>
</template>

<script setup lang="ts">
interface Props {
  leftText?: string
}
const props = withDefaults(defineProps<Props>(), {
  leftText: '返回'
})

const router = useRouter()

const onClickLeft = () => {
  router.back()
}
</script>

<style lang="scss" scoped></style>
